import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
export default new Vuex.Store({
    state:{
        //默认图标为"el-icon-s-fold"
      collapseBtnClass: "el-icon-s-fold",
      //菜单默认不折叠
      isCollapse: false,
      //默认宽度200
      sideWidth: 200,
      logoTextShow: true,
    },
    mutations:{
        MenuCollapse(state) {
            //collapse为false时展开，true是折叠
            state.isCollapse = !state.isCollapse;
           
            //折叠时宽度为64，展开时宽度为200
            if(state.isCollapse){
                state.sideWidth=64;
                state.logoTextShow=false;
                state.collapseBtnClass="el-icon-s-unfold";
                //折叠时不展示logo
                state.logoTextShow=false;
            }else{
                state.sideWidth=200;
                state.logoTextShow=true;
                state.collapseBtnClass="el-icon-s-fold";
                //展开时展示logo
                state.logoTextShow=true;
            }
          },
    }
})